package com.leagueoflegends.service.impl;

import com.github.pagehelper.PageHelper;
import com.leagueoflegends.bean.ChampionPassive;
import com.leagueoflegends.bean.ChampionPassiveDTO;
import com.leagueoflegends.bean.ChampionPassiveVO;
import com.leagueoflegends.mapper.ChampionMapper;
import com.leagueoflegends.mapper.ChampionPassiveMapper;
import com.leagueoflegends.service.ChampionPassiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChampionPassiveServiceImpl implements ChampionPassiveService {

    @Autowired
    ChampionPassiveMapper championPassiveMapper;

    @Override
    public void insert(ChampionPassive passive) {
        championPassiveMapper.insert(passive);
    }

    @Override
    public void delete(Integer championId) {
        championPassiveMapper.delete(championId);
    }

    @Override
    public void update(ChampionPassive passive) {
        championPassiveMapper.update(passive);
    }

    @Override
    public ChampionPassive select(Integer championId) {
        return championPassiveMapper.select(championId);
    }

    @Override
    public List<ChampionPassiveVO> selectAllVO() {
        return championPassiveMapper.selectAllVO();
    }

    @Override
    public Integer countChampionHavePassive() {
        return championPassiveMapper.countChampionHavePassive();
    }

    @Override
    public Integer countAllChampion() {
        return championPassiveMapper.countAllChampion();
    }

    @Override
    public List<ChampionPassiveVO> selectAll(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return championPassiveMapper.selectAllVO();
    }

    @Override
    public Integer searchChampionId(String title) {
        return championPassiveMapper.searchChampionId(title);
    }

    @Override
    public List<ChampionPassiveDTO> searchNoPassiveChampion() {
        return championPassiveMapper.searchNoPassiveChampion();
    }

    @Override
    public Integer titleToPassive(String title) {
        return championPassiveMapper.titleToPassive(title);
    }

    @Override
    public List<String> idToTitle(int id) {
        return championPassiveMapper.idToTitle(id);
    }

    @Override
    public void set0(Integer championId) {
        championPassiveMapper.set0(championId);
    }

    @Override
    public void set1(Integer championId) {
        championPassiveMapper.set1(championId);
    }
}
